package com.itheima.day20.demo07;

import java.util.function.Consumer;

/**
 * 需求：使用andThen()方法依次求出字符串"hello"的长度，然后将所有小写字母转换为大写字母。
 */
public class ConsumerDemo02 {
    public static void main(String[] args) {
        String str = "wangjie";
        consumerDemo(str, e -> System.out.println(e.length()), e -> System.out.println(e.toUpperCase()));
    }

    public static void consumerDemo(String str, Consumer<String> one, Consumer<String> two) {
        one.andThen(two).accept(str);
    }
}
